import request from "@/api/axios"

const path = {
    config: "/config/report",
    data: "/data/report",
}

export const RePortApi = {
    saveName: (code, name) => {
        return request.post_param(path.config + "/saveReportTitle", {
            code: code,
            name: name,
        })
    },

    getName: (code) => {
        return request.get(path.config + "/getReportTitle", { code: code })
    },

    saveSimpleInd: (data) => {
        return request.post(path.config + "/saveSimpleIndConfig", data)
    },

    getSimpleInd: (reportId, indId) => {
        return request.get(path.config + "/getSimpleIndConfig", {
            reportId: reportId,
            indId: indId,
        })
    },

    saveComplexInd: (data) => {
        return request.post(path.config + "/saveComplexIndConfig", data)
    },

    getComplexInd: (reportId, indId) => {
        return request.get(path.config + "/getComplexIndConfig", {
            reportId: reportId,
            indId: indId,
        })
    },
}

export const RePortDataApi = {
    getThemeName: (code) => {
        return request.get(path.data + "/getThemeName", {
            code: code,
        })
    },

    getThemeData: (code) => {
        return request.get(path.data + "/getThemeData", {
            code: code,
        })
    },
}
